using Microsoft.Xna.Framework.Graphics;
using RebelStar.Engine.Maps;

namespace RebelStar.Engine.Players.Fog
{
    class MapFogEntry
    {
        private MapEntry entry;
        private FogStatus status;

        public MapFogEntry(MapEntry entry, FogStatus status)
        {
            this.entry = entry;
            this.status = status;
        }

        public MapEntry Entry
        {
            get { return entry; }
        }
        public FogStatus Status
        {
            get { return status; }
            set { status = value; }
        }
        public Color EntryBlendColor
        {
            get
            {
                switch (status)
                {
                    case FogStatus.Blackout:
                        return Color.Black;
                    case FogStatus.Semivisible:
                        return Color.Gray;
                    case FogStatus.Visible:
                    default:
                        return Color.White;
                }
            }
        }

        public void ResetStatus()
        {
            FogStatus def = FogStatus.Semivisible;
            if (status > def)
                status = def;
        }
        public void MergeStatus(FogStatus newStatus)
        {
            if (newStatus>this.status)
                status = newStatus;
        }
    }
}
